Mask GitHub API keys by default in api-keys CLI#438
Open
iGufrankhan wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces accidental exposure of GitHub API keys by masking them by default in the collectoss github api-keys CLI output, while still allowing full key display when explicitly requested.
Changes:
- Mask API keys by default in
github api-keysoutput using the existingmask_keyhelper. - Add a
--show-keysflag to optionally display full API keys.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+75
to
+77
|
|
||
| display_key = key if show_keys else mask_key(key) | ||
| print(f"{display_key} | {core_requests} | {core_reset_time} | {graphql_requests} | {graphql_reset_time} |") |
| @test_connection | ||
| @test_db_connection | ||
| def update_api_key(): | ||
| def update_api_key(show_keys): |
Signed-off-by: iGufrankhan <gufrankhankab123@gmail.com>
192c38b to
c574cb3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR masks GitHub API keys in the
collectoss github api-keysCLI output by default using the existingmask_keyhelper.It also adds a
--show-keysflag to allow displaying the full API keys when explicitly requested.This helps reduce accidental exposure of API keys during screen sharing or shoulder surfing.
Fixes #414
Notes for Reviewers
mask_keyhelper.--show-keysflag to display the full API keys when explicitly requested.Signed commits